import instance from './index'
export const loginApi = (username, password) => {
    return instance({
        url: 'http://localhost:12345/api/user/login',
        method: 'POST',
        data: {
            username, password
        }
    })
}
export const registerApi = (username, password) => {
    return instance({
        url: 'http://localhost:12345/api/user/register',
        method: 'POST',
        data: {
            username, password
        }
    })
}
export const cartApi = (data) => {
    return instance({
        url: 'http://localhost:12345/api/order/create',
        method: 'POST',
        data: {
            ...data
        }
    })
}
export const orderApi = (orderId) => {
    return instance({
        url: 'http://localhost:12345/api/order/getOrder/' + orderId,
        method: 'GET',
    })
}
export const listApi = (username) => {
    return instance({
        url: 'http://localhost:12345/api/order/getOrderList/' + username,
        method: 'GET',
    })
}
export const payApi = (data) => {
    return instance({
        url: 'http://localhost:12345/api/order/pay',
        method: 'POST',
        data: {
            ...data
        }
    })
}
export const lbtApi = () => {
    return instance({
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata',
        method: 'GET',
    })
}
export const claApi = () => {
    return instance({
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/catitems',
        method: 'GET',
    })
}
export const floorApi = () => {
    return instance({
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/floordata',
        method: 'GET',
    })
}
export const claaApi = () => {
    return instance({
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/categories',
        method: 'GET',
    })
}
export const detailApi = (goods_id) => {
    return instance({
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/goods/detail',
        method: 'GET',
        params:{
            goods_id
        }
    })
}